<?php

class Application_Model_Factory_ObjectFactory {
	
	public static function load($class)
	{
		$mapperclasse = 'Application_Model_' . $class.'Mapper';
		$objectClass = 'Application_Model_' . $class;
	
		if (file_exists($chemin = '..\\application\\models\\'.$class . '.php'))
		{
			$object = new $objectClass;
			return $object;
		}
		else
		{
			throw new RuntimeException('La classe <strong>' . $objectClass . '</strong> n\'a pu être trouvée !');
		}
	}
}